﻿#pragma once
#include "Protocol.h"
#include "UpwardProtocol.h"
#include <stdio.h>
#include <string>
#include <QtCore/QIODevice>

namespace HadoopUtils{
	class FileOutStream;
}
namespace HadoopPipes {
class BinaryUpwardProtocol: public UpwardProtocol {
  private:
    HadoopUtils::FileOutStream* stream;
  public:
	BinaryUpwardProtocol(QIODevice* _stream) ;
    virtual void authenticate(const std::string &responseDigest);

	virtual void output(const std::string& key, const std::string& value) ;
	virtual void partitionedOutput(int reduce, const std::string& key,
		const std::string& value);

    virtual void status(const std::string& message);
    virtual void progress(float progress);
	virtual void done() ;
	virtual void registerCounter(int id, const std::string& group, 
		const std::string& name);
	virtual void incrementCounter(const TaskContext::Counter* counter, 
		uint64_t amount);
	~BinaryUpwardProtocol() throw ();
  };
}